import React from "react";
import { Menu, Modal, message } from "antd";
import { ExclamationCircleOutlined } from "@ant-design/icons";
export default function MenuDropDown({ handlerSetClick, handlerDelClick, handlerSaveClick }) {
  //是否确认删除
  const isExecuteHandlerDelClick = () => {
    Modal.confirm({
      title: "确认删除？",
      icon: <ExclamationCircleOutlined />,
      content: "删除内容后，无法恢复。",
      cancelText: "取消",
      okText: "确认",
      onOk() {
        handlerDelClick();
      },
    });
  };
  const handlerMenuClick = (e) => {
    console.log(e);
  };
  return (
    <>
      <Menu onClick={handlerMenuClick}>
        <Menu.Item key="1">查看</Menu.Item>
        <Menu.Item key="2" onClick={handlerSetClick}>
          设置
        </Menu.Item>
        <Menu.Item key="3" onClick={handlerSaveClick}>
          保存草稿
        </Menu.Item>
        <Menu.Item key="4" onClick={isExecuteHandlerDelClick}>
          删除
        </Menu.Item>
      </Menu>
    </>
  );
}
